home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / sys / fb.h < prev    next >
C/C++ Source or Header  |  1990-11-12  |  4KB  |  129 lines

  1. /*
  2.  * fb.h --
  3.  *
  4.  *    Declarations of things to do with the frame buffer device.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/lib/include/sys/RCS/fb.h,v 1.2 90/06/21 14:53:02 mgbaker Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _FBDEV
  19. #define _FBDEV
  20.  
  21. #ifndef ASM
  22.  
  23. /* 
  24.  * Set/Get attributes 
  25.  */
  26. #define    FB_ATTR_NDEVSPECIFIC    8    /* no. of device specific values */
  27. #define    FB_ATTR_NEMUTYPES    4    /* no. of emulation types */
  28.  
  29. /* 
  30.  * Video control 
  31.  * (the unused bits are reserved for future use)
  32.  */
  33. #define    FBVIDEO_OFF    0
  34. #define    FBVIDEO_ON    1
  35.  
  36. /* frame buffer type codes */
  37. #define    FBTYPE_SUN1BW        0    /* Multibus mono */
  38. #define    FBTYPE_SUN1COLOR    1    /* Multibus color */
  39. #define    FBTYPE_SUN2BW        2    /* memory mono */
  40. #define    FBTYPE_SUN2COLOR    3    /* color w/rasterop chips */
  41. #define    FBTYPE_SUN2GP        4    /* GP1/GP2 */
  42. #define    FBTYPE_SUN5COLOR    5    /* RoadRunner accelerator */
  43. #define    FBTYPE_SUN3COLOR    6    /* memory color */
  44. #define    FBTYPE_MEMCOLOR        7    /* memory 24-bit */
  45. #define    FBTYPE_SUN4COLOR    8    /* memory color w/overlay */
  46.  
  47. #define    FBTYPE_NOTSUN1        9    /* reserved for customer */
  48. #define    FBTYPE_NOTSUN2        10    /* reserved for customer */
  49. #define    FBTYPE_NOTSUN3        11    /* reserved for customer */
  50.  
  51. #define    FBTYPE_SUNFAST_COLOR    12    /* accelerated 8bit */
  52. #define    FBTYPE_SUNROP_COLOR    13    /* MEMCOLOR with rop h/w */
  53. #define    FBTYPE_SUNFB_VIDEO    14    /* Simple video mixing */
  54. #define    FBTYPE_RESERVED5    15    /* reserved, do not use */
  55. #define    FBTYPE_RESERVED4    16    /* reserved, do not use */
  56. #define    FBTYPE_RESERVED3    17    /* reserved, do not use */
  57. #define    FBTYPE_RESERVED2    18    /* reserved, do not use */
  58. #define    FBTYPE_RESERVED1    19    /* reserved, do not use */
  59.  
  60. #define    FBTYPE_LASTPLUSONE    20    /* max number of fbs (change as add) */
  61.  
  62. /* data structures */
  63. /*
  64.  * Frame buffer descriptor.
  65.  * Returned by FBIOGTYPE ioctl on frame buffer devices.
  66.  */
  67. typedef struct    fbtype {
  68.     int    fb_type;    /* as defined above */
  69.     int    fb_height;    /* in pixels */
  70.     int    fb_width;    /* in pixels */
  71.     int    fb_depth;    /* bits per pixel */
  72.     int    fb_cmsize;    /* size of color map (entries) */
  73.     int    fb_size;    /* total size in bytes */
  74. } fbtype;
  75.  
  76.  
  77. /*
  78.  * General purpose structure for passing info in and out of frame buffers
  79.  * (used for gp1)
  80.  */
  81. typedef struct    fbinfo {
  82.     int        fb_physaddr;    /* physical frame buffer address */
  83.     int        fb_hwwidth;    /* fb board width */
  84.     int        fb_hwheight;    /* fb board height */
  85.     int        fb_addrdelta;    /* phys addr diff between boards */
  86.     unsigned char    *fb_ropaddr;    /* fb va thru kernelmap */
  87.     int        fb_unit;    /* minor devnum of fb */
  88. } fbinfo;
  89.  
  90.  
  91.  
  92. /*
  93.  * Color map I/O
  94.  */
  95. typedef struct    fbcmap {
  96.     int        index;        /* first element (0 origin) */
  97.     int        count;        /* number of elements */
  98.     unsigned char    *red;        /* red color map elements */
  99.     unsigned char    *green;        /* green color map elements */
  100.     unsigned char    *blue;        /* blue color map elements */
  101. } fbcmap;
  102.  
  103.  
  104. typedef struct fbsattr {
  105.     int    flags;            /* misc flags */
  106. #define    FB_ATTR_AUTOINIT    1    /* emulation auto init flag */
  107. #define    FB_ATTR_DEVSPECIFIC    2    /* dev. specific stuff valid flag */
  108.     int    emu_type;        /* emulation type (-1 if unused) */
  109.     int    dev_specific[FB_ATTR_NDEVSPECIFIC];    /* catchall */
  110. } fbsattr;
  111.  
  112.  
  113. typedef struct fbgattr {
  114.     int    real_type;        /* real device type */
  115.     int    owner;            /* PID of owner, 0 if myself */
  116.     struct    fbtype fbtype;        /* fbtype info for real device */
  117.     struct    fbsattr sattr;        /* see above */
  118.     int    emu_types[FB_ATTR_NEMUTYPES];    /* possible emulations */
  119.                         /* (-1 if unused) */
  120. } fbgattr;
  121.  
  122. struct    fbpixrect {
  123.     struct pixrect    *fbpr_pixrect;    /* Pixrect of dev returned here. */
  124. };
  125.  
  126. #endif !ASM
  127.  
  128. #endif /* _FBDEV */
  129.